1. Field of the Invention
The present invention relates to a method and device for controlling outputs to a plurality of output devices relative to inputs and for synchronizing the updating of selected outputs with the occurrence of an external event. The method and device utilize and include the derivation of real-time interrupt signals from external events, the interrupt circuitry, and the programming of an interrupt zone in a ladder program with special instructions which are incorporated into a programmable control apparatus that is used to control industrial processes and production machinery.
A programmable control device uses as its inputs the states of switch-type devices and the input of numerical data from various sources, such as, but not limited to: position transducers, pressure sensors, liquid flow or passage of time. From these inputs, along with the user's program, the programmable control device computes logical outputs in the form of electronic switch outputs and also computes data for output to various locations. These switch outputs typically cause the starting and stopping of desired functions at predetermined times and locations during a machine cycle or a production process.
According to the teachings of the present invention, interrupt signals are derived from the transitions of the input parameters that the programmable control device uses to continuously control a plurality of output parameters, that, in turn, control a machine or a process. The interrupt signals cause the programmable control apparatus to briefly stop the execution of its normal program and to execute instead, other programs that occur in various types of specially created interrupt zones. When execution of this special interrupt program has been completed, the normal program resumes its execution. The special interrupt program instantaneously executes a group of normal program instructions in one or more interrupt zones upon the occurrence of an interrupt signal.
2. Description of the Prior Art
Prior methods for providing control signals to the desired outputs have generally operated by sequential analysis of a ladder logic diagram or program. In general, a ladder logic diagram is both read and executed from left to right and from the top down to the end of the machine or process control program. Each line of the ladder program is called a rung. The ladder diagram instructions fall into two general types of instructions: switch (bit) and data (word). There are individual instructions for input or output that operate on bits or words. Each ladder instruction refers to either a bit or a word of memory. In general, with bit instructions, each input instruction on a rung is evaluated to be either true or false. If the logical result of the input instructions are true, then the single allowable output instruction on the rung is also true. The particular bit in memory to which the output instruction refers is then changed to reflect the logical result of the input instructions.
Two special areas in a programmable control device's memory are reserved to coincide with the physical inputs and outputs. These are called an input status section and an output status section, respectively. In a prior art programmable control device, the logical condition of the data from all of the inputs is placed in the input status section. The programmable control device then sequentially and serially scans each logical condition, one at a time, and transfers the resultant bits and data to its output status section and then to the physical output devices.
The total time to process one ladder, i.e., the scan time, is dependent upon the number of logical decisions to be processed and a large number of decisions requires a longer scan time. This approach has been used successfully by the prior art control devices in many applications.
However, where extensive calculations or higher speeds have been required, these prior control devices have proven to be too slow for the machinery they are controlling.
Heretofore, various programmable control devices have only sampled their plurality of inputs from time to time for the purpose of continuously controlling a plurality of outputs in dependence on the input conditions. If an external input is changing significantly more rapidly than the programmable control device's scan time, the ladder programmer would place Immediate Input Instructions and other control action rungs dependent upon the state of the inputs in various places in the ladder program. However, more than a few Immediate Input Instructions in a ladder program are impractical because of program memory size constraints and unnecessary additional scan time.
As will be described in greater detail hereinafter, the method and device of the present invention utilizing interrupts, interrupt programming zones, and the derivation of the interrupt signal from the transitions of various input conditions, differ from the previously proposed method of synchronization of control outputs to input conditions in that the programmable control device of the present invention is truly synchronized to an external event rather than expending scan time doing comparison of the present states of its inputs to their prior states.
Greater control precision is also obtainable with the method and device of the present invention due to a much more rapid reaction of the programmable control device.